﻿<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<title>Custom ValuePicker</title>

	<script type="text/javascript" src="../../../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base','ValuePicker']"></script>
	<script type="text/javascript" src="../../../../../dojo/dojo.js" data-dojo-config="async: true,parseOnLoad: true,  has: {'dojo-bidi': true }"></script>

	<script type="text/javascript">
		require([
			"dijit/registry",		
			"doh/runner",
			"dojo/dom",
			"dojo/ready",
			"dojo/query",
			"dojox/mobile/ValuePicker",			
			"dojox/mobile/ValuePickerSlot",
			"dojox/mobile",
			"dojox/mobile/compat",
			"dojox/mobile/parser"
			], function(registry,runner,dom,ready,query){					
				ready(function(){
					runner.register("Bidi ValuePicker", [
						{
							name: "mobile",					
							runTest: function(){
								var firstSlotWidget = registry.byId('first');			    
								var node = query(".mblValuePickerSlotInput",dom.byId('first'))[0];
								runner.is(String.fromCharCode(8234), node.value.charAt(0), "label node has direction correspondent to 'textDir' of Value Picker Slot");
								firstSlotWidget.set("textDir","rtl");
								runner.is(String.fromCharCode(8235), node.value.charAt(0), "label node had direction changed after change of 'textDir'");				
								runner.assertEqual(firstSlotWidget.get("value"),firstSlotWidget.value,"No UCC directional characters are to be present in obtained value");
							}
						}
					]);	 			
					
					runner.register("log", function(){
						dom.byId('failures').innerHTML = runner._failureCount;
						dom.byId('errors').innerHTML = runner._errorCount;
					});

					runner.run();
				});
		});
    </script>
</head>
<body style="visibility:hidden;background-color:#424142;">
	<div data-dojo-type="dojox/mobile/View">
		<h1 data-dojo-type="dojox/mobile/Heading">Custom ValuePicker</h1>
		<div id="spin1" data-dojo-type="dojox/mobile/ValuePicker">
			<div data-dojo-type="dojox/mobile/ValuePickerSlot"
				data-dojo-props="labels:['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']"
				style="text-align:center;width:40px;"></div>
			<div data-dojo-type="dojox/mobile/ValuePickerSlot"
				data-dojo-props='labelFrom:3000, labelTo:3100'
				style="width:70px;"></div>
			<div data-dojo-type="dojox/mobile/ValuePickerSlot"
				data-dojo-props='labelFrom:0, labelTo:9'
				style="width:50px;"></div>
			<div id="first" data-dojo-type="dojox/mobile/ValuePickerSlot"
				data-dojo-props="labels:['pt.','px.','cm.'],textDir:'ltr'"
				style="width:50px;"></div>
		</div>
	</div>
	<br><font style="background-color: White">Errors:&nbsp;<span id="errors">?</span></font>
	<br><font style="background-color: White">Failures:&nbsp;<span id="failures">?</span></font>		
</body>
</html>
